package cn.tedu.boot07.mapper;

import cn.tedu.boot07.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Insert("INSERT INTO product VALUES(NULL,#{title},#{price},#{num})")
    int insert(Product product);
    @Select("SELECT * FROM product")
    List<Product> select();
    @Update("UPDATE product SET title=#{title},title=#{title},num=#{num} WHERE id=#{id}")
    int update(Product product);
    @Delete("DELETE FROM product WHERE id=#{id}")
    int deleteById(int id);
    @Select("SELECT * FROM product WHERE id=#{id}")
    Product selectById(int id);

}
